package com.deer.wms.quartz.task;

import com.deer.wms.ASN.manage.service.AcceptRecordService;
import com.deer.wms.ASN.manage.service.AsnMasterService;
import com.deer.wms.base.system.service.ErpService;
import com.deer.wms.ware.task.service.SoMasterService;
import com.deer.wms.ware.task.service.WaveMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 *
 * @author deer
 */
@Component("waveTask")
public class WaveTask {
    @Autowired
    private WaveMasterService waveMasterService;

    @Autowired
    private ErpService erpService;

    @Autowired
    private AsnMasterService asnMasterService;

    @Autowired
    private SoMasterService soMasterService;

    @Autowired
    private AcceptRecordService acceptRecordService;

    public void generateWaves() {

        waveMasterService.generateWaves();
        waveMasterService.waveState();
    }

    public void waveNoParams() {
        System.out.println("执行生成波次方法");
    }

    public void test() {

        erpService.saveBills();
    }

    //入库信息
    public void getPurchaseOrder() {

//        erpService.savePurchaseOrder();
        asnMasterService.savePurchaseOrder();
    }

    //物料信息
    public void getItemInfo() {
        erpService.saveItemInfo();
    }

    //出库信息
    public void getBillOutInfo() {
        soMasterService.saveBillOutInfo();
    }

    //入库回传信息
    public void getErpBillInfo() {
        acceptRecordService.billToErp();
    }

    //部门信息
    public void getDeptInfo() {
        erpService.saveDeptInfo();
    }

    //仓库信息
    public void getWareHouseInfo() {
        erpService.saveWarehouseInfo();
    }

    //出库回传信息
    public void getErpBillOutInfo() {
    soMasterService.outbillToErp();
}

    //客户信息
    public void getCustomerInfo() {
        erpService.saveCustomerInfo();
    }

    //供应商信息
    public void getSupplierInfo() {
        erpService.saveSupplierInfo();
    }

    //获取erp辅助属性
    public void getAuxProps() {
        erpService.saveAuxProps();
    }

}
